package com.wc.alorithm_blue_bridge._模拟.Q2060;

/**
 * @Author congge
 * @Date 2023/10/11 11:25
 * @description 裁纸刀
 * https://www.lanqiao.cn/problems/2060/learning/?page=2&first_category_id=1&sort=students_count&second_category_id=3
 */
public class Main {
    public static void main(String[] args) {
        int height = 20;
        int weight = 22;
//        height = 2;
//        weight = 3;
        int ans = 0;
        // 边缘的四刀
        int border = 4;
        // 沿着长边剪
        int lenCut = Math.max(height, weight) - 1;
        // 剩下的单独剪
        int lenRemainderCut = (Math.min(height, weight) - 1) * Math.max(height, weight);

        ans = border + lenCut + lenRemainderCut;
        // 沿着短边剪
        int shortCut = Math.min(height, weight) - 1;
        // 剩下的单独剪
        int shortRemainderCut = (Math.max(height, weight) - 1) * Math.min(height, weight);

        int ans2 = border + shortCut + shortRemainderCut;
        System.out.println(ans);
        System.out.println(ans2);
    }
}
